using System;
using System.Collections.Generic;
using System.Text;

namespace DuplicateFileFinder
{
    public class EventManager
    {

        public delegate void DelegateUpdateProgress(int pTotal, int pCurrent, string pDescription);
        public event DelegateUpdateProgress EventUpdateProgress;

        public delegate void DelegatePresentResultList(System.Collections.Generic.SortedList<string, ResultFile> pResultList);
        public event DelegatePresentResultList EventPresentResultList;

        public delegate void DelegateUpdateViewer();
        public event DelegateUpdateViewer EventUpdateViewer;

        public delegate void DelegatePresentPathList(System.Collections.Generic.SortedList<string, SearchPath> pPathList);
        public event DelegatePresentPathList EventPresentPathList;

        public void UpdateProgress(int pTotal, int pCurrent, string pDescription)
        {
            if (EventUpdateProgress != null) 
            {
                EventUpdateProgress(pTotal, pCurrent, pDescription); 
            }
        }

        public void PresentResultList(System.Collections.Generic.SortedList<string, ResultFile> pResultList)
        {
            if (EventPresentResultList != null) { EventPresentResultList(pResultList); }
        }

        public void PresentPathList(System.Collections.Generic.SortedList<string, SearchPath> pPathList)
        {
            if (EventPresentPathList != null) { EventPresentPathList(pPathList); }
        }

        public void UpdateViewer()
        {
            if (EventUpdateViewer != null) { EventUpdateViewer(); }
        }
         
    }
}
